import os
def get_json(filepath,list_dir=[]):
    files = os.listdir(filepath)
    for fi in files:
        fi_d = os.path.join(filepath,fi)
        if os.path.isdir(fi_d):
            dict1 = {'name':fi,'children':[]}
            list_dir.append(dict1)
            get_json(fi_d,dict1['children'])
        else:
            dict1 = {'name':fi,'children':[]}
            list_dir.append(dict1)
    file_dict=[{'open':'true','name':'root','children':list_dir}]
    return file_dict
